package com.trkj.controllers;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;


import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSON;
import com.trkj.vo.Test;
import com.trkj.vo.Test2;

@Controller
public class Hosp_queue_controll {
	
	@RequestMapping("to_hosp_patient_queue")
	public String to_hosp_patient_queue(){
		return "hosp_patient_queue";
	}
	
	@RequestMapping("get_queue_detail")
	@ResponseBody
	public List<Object> get_queue_detail(){
		String a="[{\"id\":1,\"name\":\"AllTasks\",\"begin\":\"3/4/2010\",\"end\":\"3/20/2010\",\"progress\":60,\"iconCls\":\"icon-ok\"},{\"id\":2,\"name\":\"Designing\",\"begin\":\"3/4/2010\",\"end\":\"3/10/2010\",\"progress\":100,\"_parentId\":1,\"state\":\"closed\"},{\"id\":3,\"name\":\"Database\",\"persons\":2,\"begin\":\"3/4/2010\",\"end\":\"3/6/2010\",\"progress\":100,\"_parentId\":2}]";
		String b="a\"";
		String result2=JSON.toJSONString("a");
		Test test=new Test();
		test.setBegin("1");
		test.setEnd("111");
		test.setName("11111");
		test.setPersons("1111");
		test.setProgress("1111");
		
		Test2 test2=new Test2();
		test2.setBegin("2");
		test2.setEnd("222");
		test2.setName("222");
		test2.setPersons("222");
		test2.setProgress("222");
		
		Test2 test3=new Test2();
		test3.setBegin("33");
		test3.setEnd("333");
		test3.setName("333");
		test3.setPersons("3333");
		test3.setProgress("333");
		
		List<Object> list1=new ArrayList<>();
		list1.add(test2);
		list1.add(test3);
		test.setChildren(list1);
		
		Test test11=new Test();
		test11.setBegin("1");
		test11.setEnd("111");
		test11.setName("11111");
		test11.setPersons("1111");
		test11.setProgress("1111");
		
		Test2 test22=new Test2();
		test22.setBegin("2");
		test22.setEnd("222");
		test22.setName("222");
		test22.setPersons("222");
		test22.setProgress("222");
		
		Test2 test33=new Test2();
		test33.setBegin("33");
		test33.setEnd("333");
		test33.setName("333");
		test33.setPersons("3333");
		test33.setProgress("333");
		
		List<Object> list11=new ArrayList<>();
		list11.add(test22);
		list11.add(test33);
		test11.setChildren(list11);
		
		List<Object> list=new ArrayList<Object>();
		list.add(test);
		list.add(test11);
		return list;
	}
	
	@RequestMapping("to_test2")
	public String to_test2(){
		return "test2";
	}
}
